﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Linq;
using VOL.Core.Utilities;
using VOL.Team.DTOS;
using VOL.Team.TeamIservices.TeamManagement.IServices;
using VOL.Team.TeamIServices.ProcessProcedure.IServices;

namespace VOL.WebApi.Controllers.Team.grx
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class OperationController : ControllerBase
    {
        private readonly IoperationalService _operationsService;
        private readonly ITeamledgersService _teamledgersService;
        public OperationController(IoperationalService operationalService, ITeamledgersService teamledgersService)
        {
            _operationsService = operationalService;
            _teamledgersService = teamledgersService;
        }
        /// <summary>
        /// 查询工艺路线
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public WebResponseContent GetOperational()
        {
            WebResponseContent webResponseContent = new WebResponseContent();
            var operationlist = _operationsService.GetOperational();
            return webResponseContent.OK("查询工艺路线成功", operationlist);
        }
        /// <summary>
        /// 获取工单台账信息
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public WebResponseContent GetTicketLedger()
        {
            WebResponseContent webResponseContent = new WebResponseContent();
            var operationlist = _teamledgersService.GetTicketLedger();
            return webResponseContent.OK("查询工艺路线成功", operationlist);
        }
        /// <summary>
        /// 工单台账和工艺路线
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public WebResponseContent GetTicketLedgerOperational()
        {
            WebResponseContent webResponseContent = new WebResponseContent();
            var operationlist = _teamledgersService.GetTicketLedgerOperational();
            return webResponseContent.OK("查询工艺路线成功", operationlist);
        }
    }
}
